import { defineStore } from "pinia";
import { ref } from 'vue';
import {getCategoryAPI} from '@/apis/layout.js'


export const useCategoryStore=defineStore('category',()=>{

  //state 导航列表数据
  const categoryList=ref([])
 
  // 导航列表数据获取异步方法
  const getCategory = async () => {
    const res = await getCategoryAPI();
   
    categoryList.value = res.result;
  };


  return {categoryList,getCategory}
})